﻿<Window x:Class="MusicPlayerPlus.PlugIn.DownloadMusic.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525"
        Loaded="Window_Loaded_1">
    <Window.Resources>
        <DataTemplate x:Key="DataTemplate_download">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="3*"/>
                    <RowDefinition Height="2*"/>
                </Grid.RowDefinitions>
                <Image  Source="{Binding Pic,UpdateSourceTrigger=PropertyChanged}" Height="100" Width="100" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.RowSpan="2"></Image>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Name}" VerticalAlignment="Bottom" Margin="105,0,0,0" FontSize="24"/>

                <ProgressBar Maximum="{Binding TotalBytesToReceive}" IsIndeterminate="{Binding DownloadUnStart}" Value="{Binding BytesReceived}" Height="20" Width="300" HorizontalAlignment="Left"  Grid.RowSpan="1" VerticalAlignment="Bottom"  Grid.Row="1" Margin="105,0,0,0"></ProgressBar>
                <StackPanel Width="300" HorizontalAlignment="Left"  Grid.RowSpan="1" VerticalAlignment="Bottom"  Grid.Row="1" Margin="105,0,0,2" Orientation="Horizontal">
                    <TextBlock Text="下载进度: "/>
                    <TextBlock Text="{Binding DownloadProgressPercentage}"/>
                    <TextBlock Text=" % "/>
                    <TextBlock Text="{Binding BytesReceived}"></TextBlock>
                    <TextBlock Text=" / "/>
                    <TextBlock Text="{Binding TotalBytesToReceive}"/>
                </StackPanel>

                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding DownloadCompleted}" VerticalAlignment="Top" Grid.Row="1" Margin="105,0,0,0" FontSize="18"/>
            </Grid>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <ListBox x:Name="list" ItemTemplate="{DynamicResource DataTemplate_download}"></ListBox>
    </Grid>
</Window>
